{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.2.4 建模和评估"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## statsmodels"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> `statsmodels' 是用于数据检索、估计模型，并运行统计检验的包。\n",
    "\n",
    "```Python\n",
    "conda install statsmodelst\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.style.use(\"ggplot\")\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f_name = os.path.join(\"./data/\", \"iris.data\")\n",
    "df = pd.read_csv(f_name, names=[\"sepal length\", \"sepal width\", \"petal length\", \"petal width\", \"class\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用 statsmodels 来构建一个线性回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x11ea01cf8>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAAHFCAYAAABhHfn9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X18XHWd9//XN0lZIBS7JYFYbsT7oqKuIlVhLd4roL3WSz+yVrmqspW9xK3Zol7edfllL1f0p1vqomDtakWi/D4iGAVB0ZUbV8EFV26UFrUg0BKaUAshrdBmzu+Pc9JOhiSdSc6cmeT7fj4eeSTzPWe+8znfM5n3nJuZE5IkQUREJFYtjS5ARESkkRSEIiISNQWh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zOxQYD/gGxVtzyILwvKtvOzbZD4DLAMeAT5ftiyfIg3Vl5rZecB6dz8rm/waM7sK6AR6gbP0TTMyk2iLUGRq7gJGzOzrZvZGM/vL8olmtoT0a/PeQhoQNwDfqujjb4DjSLfWlgDvydoD8GlgAXAM6Rcyn1NlXdeThh7Z759lP+Vtd7v7/ePc9++AU0kvC3Yc6VdVAeDuH8+W4Sx3P6gsBMnu8xLg+YABr6+yVpGmoCAUmYLsslknkm6xfQUYMLPvmdlh2SxnAp929zvdfTfwL8ALzewpZd18xt23ufu9pNdY+9us79+7+zXu/pi7DwD/CiyusrTrgBOzL3b/a9Lw+gXpltxo23UT3NeA89z9PnffRhrG1TjX3bdny/FT4IVV3k+kKWjXqMgUufudpLsRMbOFwMXsDbSnAGvM7PNldwmkxxL/mN0uvxjrH0m3AMnCdA1paM0lfcP6pyrLuhE4CHge6dbfBe7+qJndV9b2hQnuu2CcmqrRX/b3juzxRWYMBaFIDtx9g5mtB96XNd0HfMrdeye525HA6JWzjwK2ZH//C+mW5rHuvs3M/gdwfpV1/NnM/gt4E/Bkd9+QTboha3s+E58o8wBjr4t3VMV0HfeTWUlBKDIF2RbgKcD/5+73m9mRpFuCN2azXAj8s5n92t1/Y2ZPAl7n7t8u6+ZDZnYT6RbUCtJdoJBuBT4MPGxmh5OecFOL67P+/rOs7WfAl4AH3P0PE9zPgX8wsyuAYeD/VEx/EHhajbWIND0dIxSZmiHSi6jeZGbDpAF4B7ASwN0vJz0D8xIzeySbVvmZvT7gFuDXwJWkF2uG9GMYLyINwyuBy2qs7TrgUNLwG/WzrO2GSe73FdIzVG8FfjXO464B3mpmfzKziXavisw4uh6hSANkH594prv/vtG1iMROW4QiIhI1BaGIiERNu0ZFRCRq2iIUEZGoKQhFRCRqCkIREYmaglBERKKmIBQRkagpCEVEJGr/PzKygbb6dRVRAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10e375198>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(7, 7))\n",
    "ax.scatter(df[\"sepal width\"][:50], df[\"sepal length\"][:50])\n",
    "ax.set_ylabel(\"Sepal Length\")\n",
    "ax.set_xlabel(\"Sepal Width\")\n",
    "ax.set_title(\"Setosa Sepal Width vs. Sepal Length\", fontsize=14, y=1.02)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:           sepal length   R-squared:                       0.558\n",
      "Model:                            OLS   Adj. R-squared:                  0.548\n",
      "Method:                 Least Squares   F-statistic:                     60.52\n",
      "Date:                Tue, 28 Apr 2020   Prob (F-statistic):           4.75e-10\n",
      "Time:                        10:17:44   Log-Likelihood:                 2.0879\n",
      "No. Observations:                  50   AIC:                           -0.1759\n",
      "Df Residuals:                      48   BIC:                             3.648\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "===============================================================================\n",
      "                  coef    std err          t      P>|t|      [0.025      0.975]\n",
      "-------------------------------------------------------------------------------\n",
      "const           2.6447      0.305      8.660      0.000       2.031       3.259\n",
      "sepal width     0.6909      0.089      7.779      0.000       0.512       0.869\n",
      "==============================================================================\n",
      "Omnibus:                        0.252   Durbin-Watson:                   2.517\n",
      "Prob(Omnibus):                  0.882   Jarque-Bera (JB):                0.436\n",
      "Skew:                          -0.110   Prob(JB):                        0.804\n",
      "Kurtosis:                       2.599   Cond. No.                         34.0\n",
      "==============================================================================\n",
      "\n",
      "Warnings:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "import statsmodels.api as sm\n",
    "\n",
    "y = df[\"sepal length\"][:50]\n",
    "x = df[\"sepal width\"][:50]\n",
    "X = sm.add_constant(x)\n",
    "\n",
    "results = sm.OLS(y, X).fit()\n",
    "print(results.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x11f159fd0>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcAAAAHFCAYAAABl6CnAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xl8VNXdx/HPmUmQxSCN0VCkidY+tnbTVqtUfcQN3FDE6gGlttoqbiiusY9La9VaTUWNIiLuezguCC5VqXVrFbXQarVal2IiYlBMkSBbMnOfP+5kmAxJmCQzc2f5vl+vvJJzlzO/e+5kfnPPPfde43keIiIixSYUdAAiIiJBUAIUEZGipAQoIiJFSQlQRESKkhKgiIgUJSVAEREpSkqAIikwxtxhjHksA/XuZYzxjDEV3SxzhDFmo9crxeo5Ir0RFhZjzIfGmHOCjqO38j3+XKMEWECMMVsYY6bH/knWGmOWGmOeMcaM6kEdG/1AzpZ0bE+2GGM+McZcmDTtws6SkjHmHmPMi7HiS8BXgc978FoXG2Pe7HPQWWKM2cEYM8cY02SMWWOMaTTGPGSMqQ46tmTGmGONMSsVR3FQAiwsDwG7AL8EtgPGAH8ENg8yqD7Ip+15FtgradrewEddTP8zgOd56zzPa/IK9I4UxpgtgGeAlcDBwLeAY4APgMEBhiYCnufppwB+gCGAB+y3keX6AVcCi4FVwGvA/rF5W8fqSPy5IzZvE+BaYCmwBpgP7JFQbylwHbAEWIv/wX9Fwvyfxl6rBfgUeADYKpPbE5u/V6yeMcA/YrEvAHZKWGZz4P5YHauBt4Djkl7nDuCxbuI4Ifb6/RLaazVwMvBWwnLbxeIZmRRfRcIyPwMaYvU9Bpzq/6t6AMd2so+Ojc3zgEmxtv0S+A/w025iHg2sAzZPmn458Ebs782Au2P7bE2szjN68L48DIi0t0s3y20F1AP/j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KUpKgCIiUpSUAEVEpCjl/TnAZJ7nsWbNGqLRKMZs9BxoTlq6dClr164NOoys8DyPUChE//7983Z/iUh+KrgEuGbNGkpLSykpyd9NKykpIRwOBx1G1rS1tbFmzRoGDBgQdCgiUkQKrgs0Go3mdfIrRiUlJUSj0aDDEJEiU3AJUN1o+Un7TUSyreASoIiISCqUAIvEH/7wB1544YU+1/PSSy/xs5/9DICnn36aadOm9blOEZEg6GRZBnmeFx/l2FttbW1pOad57rnn9rmOZKNHj2b06NFpr1dEJBt0BJhmH330Ef/7v//L6aefzj777MOSJUt4/vnnOeSQQ9h///2ZNGkSX375JQDPPPMMe+65JwcccAAXXXRR/MjqD3/4A6eddhpjx47l9NNPJxKJcOmll3LQQQex3377cffddwP+5RKHH344o0aNYp999uGVV14hEolwxhlnsM8++7Dvvvsyc+ZMAM444wwee+wxAF588UVGjx7Nvvvuy1lnnRW/5GLXXXflqquuYv/992fffffl/fff73ZbZ82axQUXXBCv/6KLLuLQQw/lxz/+cfy1AG688cZ47FdddVUaW1tEpPcK+ggwWn8z3keL0lqn+do2hCac0O0yixYt4tprr2WnnXaiubmZuro6Zs2axcCBA7nhhhuYOXMmJ598Mueddx4PP/wwVVVVnHLKKR3qeO+995g9ezYDBgzgnnvuoaysjCeeeIK1a9dy2GGHMXLkSJ544glGjhzJlClTiEQirF69mrfeeoumpib+/Oc/A/DFF190qHfNmjWceeaZzJo1i2233ZbTTz+du+66ixNO8LepvLycp556ijvuuIMZM2b0KGEtXbqURx55hPfff5/jjjuOMWPG8Pzzz7No0SIef/xxPM/j2GOPZf78+YwYMSLlekVEMkFHgBkwfPhwdtppJwAWLFjAu+++y9ixYxk1ahQPPPAAixcv5v3336e6upqqqioADjvssA51jB49On5d3PPPP8+DDz7IqFGjGDNmDP/9739ZtGgRO+64I845pk6dyttvv82mm25KVVUVjY2NXHjhhTz77LOUlZV1qPeDDz6gqqqKbbfdFoAjjzySV155JT7/wAMPBOD73/8+H330UY+2+4ADDiAUCrHddtv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tr3XRBbpRWesCdc59HPv9KTAb2CVpkeOAh51znnPufWAR/tGgiEhBaKmpobW6usO01upqWmpqAoqouGUlAVprB8W6OLHWDgJGA8kXwjUC+8aWqQS+CfwnG/GJiGRDpKqK5vp6Vo0bR3TkSFaNG6cBMAHKVhdoJTDbWtv+mvc555601p4E4JybAVwK3GGt/Sd+3+15XY0YFRHJV5GqKpZPm0ZFRYW6PQOWtUEwGZLzl0FMnTqVQYMGcdJJJ3W5zJNPPsnXv/51tttuOyAz5wCbmpq46KKLuPnmm7td7rrrruP0009P62unQpdB5D61ZXqpPdOnEC6DKFpPPvkk7777bkZfY+jQoRtNfgDXX399RuMQEckVRZ8Aw42NDJk8mc2POIIhkycTbmzsc511dXXsscceHHbYYXzwwQfx6ffee2/8sUAnnHACq1ev5rXXXmPevHlcdtlljBo1ig8//JC77757g+WSTZ06ldNOO41DDjmE3XffnXvvvRfw77156aWXxh+HNGfOHMB/TNM+++wD+I8xOv7445k4cSK77747l112GQCXX345a9asYdSoUUyePLnP7SAikssK+mbYG9PZXRlKFy7s00npN954g7lz5zJv3jza2to44IAD+P73vw/4T1qYOHEiAFdeeSX3338/v/jFLxg1ahT77bcfY8aMAfxHEh111FEbLJfs7bff5tFHH2X16tXx5/stWLCAt956i3nz5tHc3MxBBx3U6b0+33rrLZ566in69evHnnvuyXHHHcf555/P7bffzrx583q17SIi+aSoE2B3d2VYPm1ar+p85ZVXOOCAA+KPMho1alR83r///W9qa2tZsWIFX375JSNHjuy0jnfeeYff//73G11u//33Z8CAAQwYMIDddtuNf/zjH7z66qscdthhhMNhtthiC0aMGMHrr7/O9ttv32HdPfbYg8GDBwOw3Xbb8fHHH7PVVlv1aptFRPJRUSfAcFNT59OXLs3I65155pnceuutfOc732HWrFm8/PLLnS53+umnp7ScMabbcncSH10UCoWK7sJ7EZGiPgcYGTq08+l9uCXXiBEjeOqpp1i9ejUrV67s0J24cuVKKisraW1tZfbs2fHpm266afxxQeDfJLuz5ZI99dRTrFmzhubmZl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IUwQeBWd2M7QlgV5Kit8HTadtTmzluBskVp/OAuZ1832nA8RHxTkR0dRrVrG74eYBmOUhvg9hL0qt5x2LWqDwDNDOzhuQCaGZmDcmnQM3MrCF5BmhmZg3JBdDMzBqSC6CZmTUkF0AzM2tILoBmZtaQXADNzKwh/R8rcqOLZCZ2SAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11f044d30>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(7,7))\n",
    "ax.plot(x, results.fittedvalues, label='regression line')\n",
    "ax.scatter(x, y, label='data point', color='r')\n",
    "ax.set_ylabel('Sepal Length')\n",
    "ax.set_xlabel('Sepal Width')\n",
    "ax.set_title('Setosa Sepal Width vs. Sepal Length', fontsize=14, y=1.02)\n",
    "ax.legend(loc=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## scikit-learn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 作者们为其设计了无与伦比的文档，为几十个算法提供了统一的API接口\n",
    "* 它建立在 Python 科学栈的核心模块之上，也就是 Scipy, pandas, matplotlib\n",
    "* scikit-learn 覆盖的一些领域包括：分类、回归、聚类、降维、模型选择和预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>predicted</th>\n",
       "      <th>actual</th>\n",
       "      <th>correct</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          predicted           actual  correct\n",
       "0   Iris-versicolor   Iris-virginica        0\n",
       "1    Iris-virginica   Iris-virginica        1\n",
       "2       Iris-setosa      Iris-setosa        1\n",
       "3       Iris-setosa      Iris-setosa        1\n",
       "4       Iris-setosa      Iris-setosa        1\n",
       "5       Iris-setosa      Iris-setosa        1\n",
       "6   Iris-versicolor  Iris-versicolor        1\n",
       "7   Iris-versicolor  Iris-versicolor        1\n",
       "8   Iris-versicolor  Iris-versicolor        1\n",
       "9    Iris-virginica   Iris-virginica        1\n",
       "10  Iris-versicolor  Iris-versicolor        1\n",
       "11      Iris-setosa      Iris-setosa        1\n",
       "12   Iris-virginica   Iris-virginica        1\n",
       "13   Iris-virginica   Iris-virginica        1\n",
       "14      Iris-setosa      Iris-setosa        1\n",
       "15  Iris-versicolor  Iris-versicolor        1\n",
       "16  Iris-versicolor   Iris-virginica        0\n",
       "17  Iris-versicolor  Iris-versicolor        1\n",
       "18      Iris-setosa      Iris-setosa        1\n",
       "19  Iris-versicolor  Iris-versicolor        1\n",
       "20  Iris-versicolor  Iris-versicolor        1\n",
       "21      Iris-setosa      Iris-setosa        1\n",
       "22      Iris-setosa      Iris-setosa        1\n",
       "23      Iris-setosa      Iris-setosa        1\n",
       "24   Iris-virginica   Iris-virginica        1\n",
       "25      Iris-setosa      Iris-setosa        1\n",
       "26   Iris-virginica   Iris-virginica        1\n",
       "27  Iris-versicolor  Iris-versicolor        1\n",
       "28      Iris-setosa      Iris-setosa        1\n",
       "29   Iris-virginica   Iris-virginica        1\n",
       "30   Iris-virginica   Iris-virginica        1\n",
       "31   Iris-virginica   Iris-virginica        1\n",
       "32   Iris-virginica   Iris-virginica        1\n",
       "33  Iris-versicolor  Iris-versicolor        1\n",
       "34      Iris-setosa      Iris-setosa        1\n",
       "35  Iris-versicolor  Iris-versicolor        1\n",
       "36  Iris-versicolor   Iris-virginica        0\n",
       "37      Iris-setosa      Iris-setosa        1\n",
       "38      Iris-setosa      Iris-setosa        1\n",
       "39   Iris-virginica   Iris-virginica        1\n",
       "40      Iris-setosa      Iris-setosa        1\n",
       "41   Iris-virginica   Iris-virginica        1\n",
       "42   Iris-virginica   Iris-virginica        1\n",
       "43  Iris-versicolor  Iris-versicolor        1\n",
       "44  Iris-versicolor  Iris-versicolor        1"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.cross_validation import train_test_split\n",
    "\n",
    "clf = RandomForestClassifier(max_depth=5, n_estimators=10)\n",
    "\n",
    "X = df.ix[:, :4]\n",
    "y = df.ix[:, 4]\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)\n",
    "\n",
    "clf.fit(X_train, y_train)\n",
    "\n",
    "y_pred = clf.predict(X_test)\n",
    "\n",
    "rf = pd.DataFrame(list(zip(y_pred, y_test)), columns=[\"predicted\", \"actual\"])\n",
    "rf[\"correct\"] = rf.apply(lambda r: 1 if r[\"predicted\"] == r[\"actual\"] else 0, axis=1)\n",
    "rf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.93333333333333335"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rf[\"correct\"].sum() / rf[\"correct\"].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([<matplotlib.axis.XTick at 0x1206482b0>,\n",
       "  <matplotlib.axis.XTick at 0x11f70c208>,\n",
       "  <matplotlib.axis.XTick at 0x1202c3eb8>,\n",
       "  <matplotlib.axis.XTick at 0x120380f98>],\n",
       " <a list of 4 Text xticklabel objects>)"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAElpJREFUeJzt3X+QXXV5x/H3NnsZoSg4va3TTfiRYVI1oqBgrAoC2lRgWtFxfYDQOlhsGhGn/UPF+gtGbI3FVtMaYCKjjNUmPlJRB9FgralRVKIVgRC1MTqGrDPMquAPEBLd/nFO9LIk3LO7d/fu/e77NbOTPed+7z3PfXLO5577vT92aGJiAklSWX6n3wVIknrPcJekAhnuklQgw12SCmS4S1KBDHdJKpDhLkkFMtwlqUCGuyQVaLiP2/ajsZI0PUPdBvQz3BkbG+vn5qet3W4zPj7e7zIGmj2cGfs3M4Pcv5GRkUbjnJaRpAIZ7pJUIMNdkgpkuEtSgQx3SSqQ4S5JBTLcJalAjd7nHhFnAuuARcC1mbl20uVHAB8Cjq5v812Z+YEe1ypJaqjrmXtELALWA2cBy4HzI2L5pGGvBu7KzBOA04F/johDelzrvDA6OsrKlSv7XYYkPaom0zIrgJ2ZuSszHwI2AedMGjMBPDYihoDDgR8D+3paqSSpsSbhvhjY3bF8d72u03uBJwNjwB3A32bmr3tSoSRpynr13TIvBG4Dng8cB3w2IrZm5k87B0XEamA1QGbSbrd7tPm502q1GBoaGsja55Ph4WF7OAP2b2YWQv+ahPse4KiO5SX1uk6vANZm5gSwMyK+BzwJuLVzUGZuADbUixOD+MU9e/fupdVqDeyXDs0Xg/zFTfOB/ZuZQe5f0y8OaxLu24BlEbGUKtTPA1ZNGvMD4AXA1oh4AvBEYFfjaiVJPdV1zj0z9wGXAJuBHdWq3B4RayJiTT3sCuA5EXEH8Dng0swczIdFSSrA0MRE3/5mxsQgfp/76OgorVaLjRs39ruUgTbIT4vnA/s3M4Pcv3papusf6/ATqpJUIMNdkgpkuEtSgQx3SSqQ4S5JBTLcJalAhrskFchwl6QCGe6SVCDDXZIKZLhLUoEMd805/1ShNPsM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\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x120676be0>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "f_importances = clf.feature_importances_\n",
    "f_names = df.columns[:4]\n",
    "f_std = np.std([tree.feature_importances_ for tree in clf.estimators_], axis=0)\n",
    "\n",
    "zz = zip(f_importances, f_names, f_std)\n",
    "zzs = sorted(zz, key=lambda x: x[0], reverse=True)\n",
    "\n",
    "imps = [x[0] for x in zzs]\n",
    "labels = [x[1] for x in zzs]\n",
    "errs = [x[2] for x in zzs]\n",
    "plt.bar(range(len(f_importances)), imps, color=\"r\", yerr=errs, align=\"center\")\n",
    "plt.xticks(range(len(f_importances)), labels)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### svm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>predicted</th>\n",
       "      <th>actual</th>\n",
       "      <th>correct</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>Iris-versicolor</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>Iris-setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>Iris-virginica</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          predicted           actual  correct\n",
       "0    Iris-virginica   Iris-virginica        1\n",
       "1    Iris-virginica   Iris-virginica        1\n",
       "2   Iris-versicolor      Iris-setosa        0\n",
       "3       Iris-setosa      Iris-setosa        1\n",
       "4   Iris-versicolor  Iris-versicolor        1\n",
       "5    Iris-virginica   Iris-virginica        1\n",
       "6       Iris-setosa      Iris-setosa        1\n",
       "7   Iris-versicolor  Iris-versicolor        1\n",
       "8   Iris-versicolor  Iris-versicolor        1\n",
       "9   Iris-versicolor  Iris-versicolor        1\n",
       "10      Iris-setosa      Iris-setosa        1\n",
       "11      Iris-setosa      Iris-setosa        1\n",
       "12   Iris-virginica  Iris-versicolor        0\n",
       "13   Iris-virginica   Iris-virginica        1\n",
       "14  Iris-versicolor   Iris-virginica        0\n",
       "15  Iris-versicolor  Iris-versicolor        1\n",
       "16   Iris-virginica   Iris-virginica        1\n",
       "17  Iris-versicolor  Iris-versicolor        1\n",
       "18   Iris-virginica  Iris-versicolor        0\n",
       "19   Iris-virginica   Iris-virginica        1\n",
       "20      Iris-setosa      Iris-setosa        1\n",
       "21      Iris-setosa      Iris-setosa        1\n",
       "22      Iris-setosa      Iris-setosa        1\n",
       "23   Iris-virginica  Iris-versicolor        0\n",
       "24  Iris-versicolor  Iris-versicolor        1\n",
       "25      Iris-setosa      Iris-setosa        1\n",
       "26      Iris-setosa      Iris-setosa        1\n",
       "27      Iris-setosa      Iris-setosa        1\n",
       "28  Iris-versicolor  Iris-versicolor        1\n",
       "29   Iris-virginica   Iris-virginica        1\n",
       "30  Iris-versicolor  Iris-versicolor        1\n",
       "31  Iris-versicolor  Iris-versicolor        1\n",
       "32  Iris-versicolor   Iris-virginica        0\n",
       "33      Iris-setosa      Iris-setosa        1\n",
       "34  Iris-versicolor  Iris-versicolor        1\n",
       "35  Iris-versicolor  Iris-versicolor        1\n",
       "36      Iris-setosa      Iris-setosa        1\n",
       "37  Iris-versicolor  Iris-versicolor        1\n",
       "38      Iris-setosa      Iris-setosa        1\n",
       "39   Iris-virginica   Iris-virginica        1\n",
       "40  Iris-versicolor  Iris-versicolor        1\n",
       "41  Iris-versicolor  Iris-versicolor        1\n",
       "42   Iris-virginica   Iris-virginica        1\n",
       "43      Iris-setosa      Iris-setosa        1\n",
       "44   Iris-virginica   Iris-virginica        1"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.multiclass import OneVsRestClassifier\n",
    "from sklearn.svm import SVC\n",
    "from sklearn.cross_validation import train_test_split\n",
    "\n",
    "clf = OneVsRestClassifier(SVC(kernel=\"linear\"))\n",
    "\n",
    "X = df.ix[:, :4]\n",
    "y = np.array(df.ix[:, 4]).astype(str)\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)\n",
    "clf.fit(X_train, y_train)\n",
    "\n",
    "y_pred = clf.predict(X_test)\n",
    "\n",
    "rf = pd.DataFrame(list(zip(y_pred, y_test)), columns=[\"predicted\", \"actual\"])\n",
    "rf[\"correct\"] = rf.apply(lambda r: 1 if r[\"predicted\"] == r[\"actual\"] else 0, axis=1)\n",
    "rf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8666666666666667"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rf[\"correct\"].sum() / rf[\"correct\"].count()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
